import { PageParams, PageResult } from "@/types/common";
import { UserResult } from "@/types/user";
import request from "@/utils/request";
/**
 * 分页查询  query参数
 * @param data 
 * @returns 
 */
export const getUserPageAPI = (params: PageParams & { name?: string, phone?: string, idNumber?: string }) => {
  return request<PageResult<UserResult[]>>({
    method: 'GET',
    url: '/admin/user/page',
    params
  })
}
/**
 * 启用、禁用用户账号  query参数
 * @param status 
 * @param id 
 * @returns 
 */
export const postUserStatusAPI = (status: number, id: number) => {
  return request({
    method: 'POST',
    url: `/admin/user/status/${status}`,
    params: { id }
  })
}
/**
 * 根据id查询用户
 * @param id 
 * @returns 
 */
export const getUsereAPI = (id: number) => {
  return request<UserResult>({
    method: 'GET',
    url: `/admin/business/${id}`
  })
}